<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QPainter.PixmapFragment Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QPainter.PixmapFragment Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>This class is used in conjunction with the <a href="qpainter.html#drawPixmapFragments">QPainter.drawPixmapFragments</a>()
function to specify how a pixmap, or sub-rect of a pixmap, is
drawn. <a href="#details">More...</a></p>

<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qpainter-pixmapfragment.html#PixmapFragment">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qpainter-pixmapfragment.html#PixmapFragment-2">__init__</a></b> (<i>self</i>, PixmapFragment)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />PixmapFragment <b><a href="qpainter-pixmapfragment.html#create">create</a></b> (QPointF&#160;<i>pos</i>, QRectF&#160;<i>sourceRect</i>, float&#160;<i>scaleX</i>&#160;=&#160;1, float&#160;<i>scaleY</i>&#160;=&#160;1, float&#160;<i>rotation</i>&#160;=&#160;0, float&#160;<i>opacity</i>&#160;=&#160;1)</li></ul><h3>Members</h3><ul><li><div class="fn" />float <b><a href="qpainter-pixmapfragment.html#height-var">height</a></b></li><li><div class="fn" />float <b><a href="qpainter-pixmapfragment.html#opacity-var">opacity</a></b></li><li><div class="fn" />float <b><a href="qpainter-pixmapfragment.html#rotation-var">rotation</a></b></li><li><div class="fn" />float <b><a href="qpainter-pixmapfragment.html#scaleX-var">scaleX</a></b></li><li><div class="fn" />float <b><a href="qpainter-pixmapfragment.html#scaleY-var">scaleY</a></b></li><li><div class="fn" />float <b><a href="qpainter-pixmapfragment.html#sourceLeft-var">sourceLeft</a></b></li><li><div class="fn" />float <b><a href="qpainter-pixmapfragment.html#sourceTop-var">sourceTop</a></b></li><li><div class="fn" />float <b><a href="qpainter-pixmapfragment.html#width-var">width</a></b></li><li><div class="fn" />float <b><a href="qpainter-pixmapfragment.html#x-var">x</a></b></li><li><div class="fn" />float <b><a href="qpainter-pixmapfragment.html#y-var">y</a></b></li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>This class is used in conjunction with the <a href="qpainter.html#drawPixmapFragments">QPainter.drawPixmapFragments</a>()
function to specify how a pixmap, or sub-rect of a pixmap, is
drawn.</p>
<p>The <i>sourceLeft</i>, <i>sourceTop</i>, <i>width</i> and
<i>height</i> variables are used as a source rectangle within the
pixmap passed into the <a href="qpainter.html#drawPixmapFragments">QPainter.drawPixmapFragments</a>()
function. The variables <i>x</i>, <i>y</i>, <i>width</i> and
<i>height</i> are used to calculate the target rectangle that is
drawn. <i>x</i> and <i>y</i> denotes the center of the target
rectangle. The <i>width</i> and <i>height</i> in the target
rectangle is scaled by the <i>scaleX</i> and <i>scaleY</i> values.
The resulting target rectangle is then rotated <i>rotation</i>
degrees around the <i>x</i>, <i>y</i> center point.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="PixmapFragment" />PixmapFragment.__init__ (<i>self</i>)</h3><h3 class="fn"><a name="PixmapFragment-2" />PixmapFragment.__init__ (<i>self</i>, <a href="qpainter-pixmapfragment.html">PixmapFragment</a>)</h3><h3 class="fn"><a name="create" /><a href="qpainter-pixmapfragment.html">PixmapFragment</a> PixmapFragment.create (<a href="qpointf.html">QPointF</a>&#160;<i>pos</i>, <a href="qrectf.html">QRectF</a>&#160;<i>sourceRect</i>, float&#160;<i>scaleX</i>&#160;=&#160;1, float&#160;<i>scaleY</i>&#160;=&#160;1, float&#160;<i>rotation</i>&#160;=&#160;0, float&#160;<i>opacity</i>&#160;=&#160;1)</h3><p>This is a convenience function that returns a <a href="qpainter-pixmapfragment.html">QPainter.PixmapFragment</a> that is
initialized with the <i>pos</i>, <i>sourceRect</i>, <i>scaleX</i>,
<i>scaleY</i>, <i>rotation</i>, <i>opacity</i> parameters.</p>
<p>This function was introduced in Qt 4.7.</p>
<hr /><h2>Member Documentation</h2><h3 class="fn"><a name="height-var" />float height</h3><p>This variable holds the height of the source rectangle and is
used to calculate the height of the target rectangle.</p>


<h3 class="fn"><a name="opacity-var" />float opacity</h3><p>This variable holds the opacity of the target rectangle, where
0.0 is fully transparent and 1.0 is fully opaque.</p>


<h3 class="fn"><a name="rotation-var" />float rotation</h3><p>This variable holds the rotation of the target rectangle in
degrees. The target rectangle is rotated after it has been
scaled.</p>


<h3 class="fn"><a name="scaleX-var" />float scaleX</h3><p>This variable holds the horizontal scale of the target
rectangle.</p>


<h3 class="fn"><a name="scaleY-var" />float scaleY</h3><p>This variable holds the vertical scale of the target
rectangle.</p>


<h3 class="fn"><a name="sourceLeft-var" />float sourceLeft</h3><p>This variable holds the left coordinate of the source
rectangle.</p>


<h3 class="fn"><a name="sourceTop-var" />float sourceTop</h3><p>This variable holds the top coordinate of the source
rectangle.</p>


<h3 class="fn"><a name="width-var" />float width</h3><p>This variable holds the width of the source rectangle and is
used to calculate the width of the target rectangle.</p>


<h3 class="fn"><a name="x-var" />float x</h3><p>This variable holds the x coordinate of center point in the
target rectangle.</p>


<h3 class="fn"><a name="y-var" />float y</h3><p>This variable holds the y coordinate of the center point in the
target rectangle.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.9.5-9eb6aac99275 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.3</td></tr></table></div></address></body></html>